home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / shllutil.lha / shellutils-1.8 / src / yes.c < prev   
C/C++ Source or Header  |  1991-07-19  |  1KB  |  40 lines

  1. /* yes - output a string repeatedly until killed
  2.    Copyright (C) 1991 Free Software Foundation, Inc.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 2, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /* David MacKenzie <djm@ai.mit.edu> */
  19.  
  20. #include <stdio.h>
  21.  
  22. void
  23. main (argc, argv)
  24.      int argc;
  25.      char **argv;
  26. {
  27.   int i;
  28.  
  29.   if (argc == 1)
  30.     while (1)
  31.       puts ("y");
  32.  
  33.   while (1)
  34.     for (i = 1; i < argc; i++)
  35.       {
  36.     fputs (argv[i], stdout);
  37.     putchar (i == argc - 1 ? '\n' : ' ');
  38.       }
  39. }
  40.